package test;

import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import dsa.InfixtoPostfixEvaluator;

public class GavinDavisIPETest {

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}
	
	@Test
	public void ipeEvalTest()
	{
		String answer = "";
		answer = InfixtoPostfixEvaluator.eval("5 * 5 + 10 / 2 * 5");
		assertEquals(answer.equals("5 5 * 10 2 / 5 * +"), true);
		answer = InfixtoPostfixEvaluator.eval("( 5 * 5 + 5 ) / 2 * 5");
		assertEquals(answer.equals("5 5 * 5 + 2 / 5 *"), true);
		answer = InfixtoPostfixEvaluator.eval("( ( ( 5 ^ 2 + 25 ) / 10 ) - 4 ) * 2");
		assertEquals(answer.equals("5 2 ^ 25 + 10 / 4 - 2 *"), true);
		answer = InfixtoPostfixEvaluator.eval("1 + 2 * 3 - 5 / 2 + 0 + 19 / 2 ^ 2");
		assertEquals(answer.equals("1 2 3 * + 5 2 / - = + 19 2 2 ^ / +"), true);
		answer = InfixtoPostfixEvaluator.eval("100 * ( ( ( 10 - 2 ) + 12 ) / 2 ) + 4500 * 2");
		assertEquals(answer.equals("100 10 2 - 12 + 2 / * 4500 2 * +"), true);
		
		
	}
	
	

}
